package com.awakening.ChannelHandler;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * @Author:AwakeningCode
 * @Date: Created in 16:28 2018\3\6 0006
 */
@ChannelHandler.Sharable
//使用注解@Sharable标注
public class SharableHandler extends ChannelInboundHandlerAdapter{

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("Channel read message: " + msg);
        //记录方法调用，并转发给下一个ChannelHandler
        ctx.fireChannelRead(msg);
    }

}
